import socket

def GoCar(command):
    # 定义主机地址和端口号
    host_ip = "192.168.1.100"
    host_port = 10000

    # 定义小车地址和端口号
    car_ip = "192.168.1.10"
    car_port = 5000

    # 创建UDP套接字
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.sendto(command.encode(), (car_ip, car_port))

# while True:
#     # 等待用户输入命令
#     command = input("请输入命令: ")
#     if(command == "退出"):
#         break
#     GoCar(command)
#     # 发送命令给小车




